<%@ page contentType="text/html;charset=euc-kr" %>
<%@ page import="java.util.*"%>
<%@ page import="eastar.util.*"%>

<%
	HashMap map	= (HashMap)request.getAttribute("result");


	String result	= StringUtil.nvl(map.get("result"));
	String message	= StringUtil.nvl(map.get("message"));
	String target	= StringUtil.nvl(map.get("target"), "_self");
	String action	= StringUtil.nvl(map.get("action"));
	
	
	Enumeration parameterNames = request.getParameterNames(); 

    String name = "";

    while(parameterNames.hasMoreElements())
    {
        name = (String)parameterNames.nextElement();
        System.out.println(name);
		if (name.startsWith("s_")) {
			if (action.indexOf("?") > -1) {
	        	action += "&" + name + "=" + StringUtil.toHan(request.getParameter(name));
			} else {
				action += "?" + name + "=" + StringUtil.toHan(request.getParameter(name));
			}
        }
    }
    
    System.out.println("action:" + action);
%>	



<HTML>
<HEAD>


</HEAD>

<BODY> 
<SCRIPT language="javascript">
    if("<%= message %>" != "")
    {
		alert("<%= message %>");
    } 
    
    if (<%= result %>)
    {
<%
		if (target.equals("_opener"))
		{
%>
			if (opener == undefined || opener == null) {
				document.location.replace("<%= action %>");
			} else {
				opener.document.frm.action = "<%= action %>";
				opener.document.frm.submit();
				self.close()	
			}
<%
		}
		else
		{
%>			
            document.location.replace("<%= action %>");
<%
		}
%>						
	}
	else
	{
		history.back(-1);
	}
</SCRIPT>

</BODY>

</HTML>
	